import React, { Component } from 'react'
import Context from '../../utils/context'
export default class Alert2 extends Component {
    state = { typeIndex: 0 }
    static contextType = Context;
    render() {
        let { n, closeAlert1 } = this.context
        return (
            <div className='alert1'>
                <div className='con'>
                    <h1 onClick={closeAlert1}>关闭</h1>
                    <div></div>
                    <div><button onClick={this.addCar}>加入购物车</button>:{this.state.n}</div>
                </div>
            </div>
        )

    }

}
